package com.book.system.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.book.common.annotation.group.InsertGroup;
import com.book.common.annotation.group.UpdateGroup;
import com.book.common.core.domain.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

import javax.validation.constraints.NotBlank;

/**
 * @author Bigboss
 * @create 2024-10-20 15:07
 */
@ApiModel("书籍章节")
@TableName("book_chapter")
public class BookChapter extends BaseEntity {

    /**
     * 章节id
     */
    @ApiModelProperty("章节id")
    @TableId(value = "id",type = IdType.ASSIGN_ID)
    @NotBlank(message = "请选择要修改的记录",groups = {UpdateGroup.class})
    private String id;

    /**
     * 书籍id
     */
    @ApiModelProperty("书籍id")
    @NotBlank(message = "请选择对应的书籍",groups = {InsertGroup.class,UpdateGroup.class})
    private String bookId;


    /**
     * 所在章节数
     */
    @ApiModelProperty("章节数")
    private Integer chapter;


    /**
     * 标题
     */
    @ApiModelProperty("章节标题")
    @NotBlank(message = "请输入标题",groups = {InsertGroup.class,UpdateGroup.class})
    private String title;


    /**
     * 章节内容
     */
    @ApiModelProperty("章节内容")
    @NotBlank(message = "请输入章节内容",groups = {InsertGroup.class,UpdateGroup.class})
    private String content;

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getBookId() {
        return bookId;
    }

    public void setBookId(String bookId) {
        this.bookId = bookId;
    }

    public Integer getChapter() {
        return chapter;
    }

    public void setChapter(Integer chapter) {
        this.chapter = chapter;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    @Override
    public String toString() {
        return "BookChapter{" +
                "id='" + id + '\'' +
                ", bookId='" + bookId + '\'' +
                ", chapter=" + chapter +
                ", title='" + title + '\'' +
                ", content='" + content + '\'' +
                '}';
    }
}
